package com.netstar.salesman_90dsp.config;

/**
 * 服务器相关服务配置
 * 
 * @author zhangshuai
 * 
 */
public class WebServerConfig {
	/**
	 * 超时时间
	 */
	public static int timeout = 10 * 1000;
	/**
	 * 在 sharedpreference 中 cookie
	 */
	public static String cookieName = "Set-Cookie";
	/**
	 * 服务器 头，不加密
	 */
	private static String serverHttp = "http://";
	/**
	 * 服务器 头，加密
	 */
	private static String serverHttps = "https://";
	/**
	 * 服务器ip
	 */
	private static String serverIp = "10.129.213.173";
	/**
	 * 服务器 端口
	 */
	private static String serverPort = "8880";
	/**
	 * 项目名称
	 */
	private static String serverName = "CA";
	/**
	 * 服务器地址
	 */
	private static String serverHttpUrl = serverHttp + serverIp + ":"
			+ serverPort + "/" + serverName + "/";
	/**
	 * 登录接口
	 */
	public static String loginAction = "Mobile/Login";
	/**
	 * 今日工作 列表 接口
	 */
	public static String todayWorkListAction = "DayPlan/List";
	/**
	 * 今日工作 添加 接口
	 */
	public static String todayWorkAddAction = "DayPlan/Input";
	/**
	 * 今日工作 删除 接口
	 */
	public static String todayWorkDeleteAction = "DayPlan/Del";
	/**
	 * 今日工作 完成 接口
	 */
	public static String todayWorkCompleteAction = "DayPlan/Input";
	/**
	 * 年度目标，新增 接口
	 */
	public static String yearTargeAddtction = "YearPlan/Input";
	/**
	 * 获得地址
	 */
	public static String getUrl(String action) {
		return serverHttpUrl + action;
	}

	/**
	 * 初始化 OA项目地址
	 * 
	 * @param isHttp
	 *            true 为 http， false 为 https
	 */
	public static void initOAHttpUrl(boolean isHttp) {
		serverHttpUrl = isHttp ? serverHttp + serverIp + ":" + serverPort + "/"
				+ serverName + "/" : serverHttps + serverIp + ":" + serverPort
				+ "/" + serverName + "/";
	}

	/**
	 * 登录参数对应的key
	 * 
	 * @author zhangshuai
	 * 
	 */
	public static class LoginRequestParamKeys {
		/**
		 * 用户登录名
		 */
		public final static String userAccount = "useraccount";
		/**
		 * 用户登录密码
		 */
		public final static String pwd = "pwd";
	}

	/**
	 * 今日工作列表参数对应的key
	 * 
	 * @author zhangshuai
	 * 
	 */
	public static class TodayWorkListRequestParamKeys {
		/**
		 * 用户id
		 */
		public final static String userId = "userid";
		/**
		 * 当前页数
		 */
		public final static String page = "page";
		/**
		 * 页数多少
		 */
		public final static String rows = "rows";
		/**
		 * 指定的日期
		 */
		public final static String appointDate = "plandate";
	}

	/**
	 * 今日工作，新增，参数对应的key
	 * 
	 * @author zhangshuai
	 * 
	 */
	public static class TodayWorkAddRequestParamKeys {
		/**
		 * 工作id
		 */
		public final static String id = "id";
		/**
		 * 用户id
		 */
		public final static String userId = "userid";
		/**
		 * 工作发表时间
		 */
		public final static String planDate = "plandate";
		/**
		 * 工作内容
		 */
		public final static String plans = "plans";
		/**
		 * 完成状态 0:未完成；1:完成
		 */
		public final static String state = "state";
	}

	/**
	 * 今日工作，删除，参数对应的key
	 * 
	 * @author zhangshuai
	 * 
	 */
	public static class TodayWorkDeleteRequestParamKeys {
		/**
		 * 工作id
		 */
		public final static String id = "id";
	}
	/**
	 * 年度目标，新增，参数对应的key
	 * 
	 * @author zhangshuai
	 * 
	 */
	public static class YearTargetAddRequestParamKeys {
		/**
		 * 工作id
		 */
		public final static String id = "id";
		/**
		 * 用户id
		 */
		public final static String userId = "userid";
		/**
		 * 目标
		 */
		public final static String target = "plans";
		/**
		 * 理由和动机
		 */
		public final static String reason = "reason";
		/**
		 * 备注
		 */
		public final static String remark = "remark";
		/**
		 * 感想
		 */
		public final static String feeling = "feelings";
		/**
		 * 完成状态 0:未完成；1:完成
		 */
		public final static String isComplete = "iscomplete";
	}
}
